package com.zhiyun.test.demo.controller;

import com.zhiyun.test.base.controller.BaseController;
import com.zhiyun.test.base.util.PropUtil;
import com.zhiyun.test.base.util.ThreadUtil;
import com.zhiyun.test.demo.service.LoginService;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

/**
 * Created by user on 2019-5-27.
 */
public class LoginController extends BaseController{
  private LoginService loginService;
  @BeforeClass
  public void beforeClass(){
    super.beforeClass();
    loginService = new LoginService(webDriver);
    webDriver.get(PropUtil.getProp("site.prop","url"));
    ThreadUtil.sleep(2);
  }
  @Test
  @Parameters({"username","password"})
  public void login(String username,String password){
    loginService.login(username,password);
  }
}
